

<div class="layui-form" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">软件产品名称</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="product_name" id="product_name" value="{{ d.params.product_name || '' }}" lay-verify="required" placeholder="请输入软件产品名称" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">软件产品简介</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="intro" id="intro" value="{{ d.params.intro || '' }}" lay-verify="required" placeholder="请输入软件产品简介" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">Banner</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="banner_url" id="banner_url" value="{{ d.params.banner_url || '' }}" placeholder="请上传图片" autocomplete="off" class="layui-input" >
      </script>
    </div>
    <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-list">上传图片</button> 
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">操作指南</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="text" name="attachment_url" id="attachment_url" value="{{ d.params.attachment_url || '' }}" placeholder="请上传附件" autocomplete="off" class="layui-input" >
      </script>
    </div>
    <button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-file">上传附件</button> 
  </div>
  <script type="text/html" template>
      <input type="hidden" name="id" id="id" value="{{ d.params.id || '' }}">
  </script>
  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="LAY-product-back-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>

<script>
layui.use(['admin', 'form', 'upload'], function(){
  var $ = layui.$
  ,admin = layui.admin
  ,view = layui.view
  ,table = layui.table
  ,form = layui.form
  ,upload = layui.upload;

  upload.render({
    elem: '#layuiadmin-upload-list'
    ,url: layui.setter.apiUrl+'/admin/common/upload_file'
    ,accept: 'images'
    ,method: 'get'
    ,acceptMime: 'image/*'
    ,done: function(res){
      $(this.item).prev("div").children("input").val(res.data.src)
    }
  });

  upload.render({
    elem: '#layuiadmin-upload-file'
    ,url: layui.setter.apiUrl+'/admin/common/upload_file'
    ,accept: 'file'
    ,method: 'get'
    ,done: function(res){
      $(this.item).prev("div").children("input").val(res.data.src)
    }
  });
})
</script>